#!/bin/bash

# 检查是否传递了参数
if [ $# -eq 0 ]; then
  echo "Usage: $0 <file_path>"
  exit 1
fi

# 获取传递的文件路径参数
ASCENDC_FILE=$1

# 检查文件是否存在
if [ ! -f "$ASCENDC_FILE" ]; then
  echo "AscendC File $ASCENDC_FILE does not exist."
  exit 1
fi

rm -f src/curr_op.cpp src/pybind11.cpp
python generate_unified_files.py ${ASCENDC_FILE} --cpp-output ./src/curr_op.cpp --pybind-output ./src/pybind11.cpp

rm -rf build
mkdir build
cd build
cmake ../src
make

# python ../verifier/verifier.py
